﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAccessLayer
{
    public class CategoryRepository
    {
        StationeryInventoryEntities1 ent;

        public CategoryRepository()
        {
            ent = new StationeryInventoryEntities1();
        }

        #region Select Method

        public List<Category> GetAllCategory()
        {
            List<Category> list = new List<Category>();

            var cat = ent.Categories.OrderBy(x => x.CategoryName);

            if (cat != null)
            {
                list = cat.ToList();
            }

            return list;
        }

        #endregion

    }
}
